package com.example.rjb_shoping.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.xq.softcup.mq.client.factory.MqClientFactory;

/**
 * 消息队列配置类
 */
@Configuration
public class XqmqConfig {
    @Value("${xqmq.adminAddress}")
    private String adminAddress;
    @Value("${xqmq.accessToken}")
    private String accessToken;

    @Bean
    public MqClientFactory getConsumer() {
        MqClientFactory factory = new MqClientFactory();
        factory.setAdminAddress(adminAddress); //远程服务地址
        factory.setAccessToken(accessToken);
        return factory;
    }
}
